package ${packageName}.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public abstract class BaseEntity {

    /**
    * id
    **/
    @TableId(type = IdType.AUTO)
    @TableField(value = "id")
    protected String id;

    /**
    * 创建人
    **/
    @TableField(value = "create_by")
    protected String createBy;

    /**
    * 创建时间
    **/
    @TableField(value = "create_time")
    protected LocalDateTime createTime;

    /**
    * 更新人
    **/
    @TableField(value = "update_by")
    protected String updateBy;

    /**
    * 更新时间
    **/
    @TableField(value = "update_time")
    protected LocalDateTime updateTime;

    /**
    * 是否删除
    **/
    @TableField(value = "deleted")
    protected Integer deleted;

    /**
    * 删除时间
    **/
    @TableField(value = "delete_time")
    protected LocalDateTime deleteTime;

    /**
    * 版本号
    */
    @Version
    @TableField(value = "version")
    protected Integer version;

}
